package com.novel.config;


import com.alipay.api.DefaultAlipayClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


@Configuration
public class AliPayConfig {

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2016110200785498";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCB2yDo9nD/sHEH6Cr1JSDrB33y1wrLinXHeIEDiIDTc70/Zjld4eOq1LMGLxC0xj/zBy76bXbXhKgyxybZ0vQyxDW3PEu3wjzgDyVi8r2yWWj1/RpmZlYXxVyxKNtBs6UVBabF73aD0y7dl4PXRUOqSxIzysiWGEJ0M+jsWi5CUjMV2+f8sY2eA+PHdLxXcbvc5zPxjRuXeXphFF4zPaKxg2msbFd5p911yLA6gwndJdcj6tAEjASkKXsjN6qP2Tg98wQiz2A+sO2873Iv4grfo0aVRGMqdtVgxyybPYX+2nnv3gubnYrdKzQNp6KckfyLUt0fnaO9ULvourhz0a59AgMBAAECggEACMGAx5SOa/82r+TMuLjnLlHUAULUvIK6jFeow1c58IgWU6cN6TGpC0TKSXl08+uGNlnepg4pfEC6oqnhCcD6rE2knZVYOazENAtxZumdNuBmfmexlwQBfBrXtC5gEl8Nm4xFAYWzBRKBT3m+7w4BkQL82DctLUm3eWRiqUUvZ1NQ6PF787gEdgH4gLnZ97sbxPeTLj01ZhPllx01gEmEnHCu6DgXZEDERfMneCnUiX4PoSJ9EId4ebDOWuHyA3+8nPholl7CPX0uiGUGXB5na6lrW5TGmzVZ/OetnN2j69OksK5d5NCYOl+Pl4op2Iby+okWInQNOtFAcOmEiaE/NQKBgQDF2BoCqZtwFqoknJ9riUOe8sKvS1K65zWyIwx2I5x5EuEJxM1H3T2xr6kAlf5ATkilXTIhAG5faS2djObZ0FgpWLtGLV3/BqHbY4rIsyjidlc2GCGIQQk6KNCoppxOcLrzAMuzdyLuTuVka75tH+eZ6UITlqYcXxPg1Tgt2AcMzwKBgQCoBt+QGGdEZj8gZOsOyZlflu7OlLXLCNM9fs9jMeyJnWaRrHkjZ1cUu8mEdxU6cruHciJlu0PDopt280dSFW5lz1F9Qw0fZO50c7hFi/kVSkFJuarAfvPDwYMV6W8tKIlHxQKNuACptUXe+oCtig9F3vKukMbicbuYYysYtNSa8wKBgBHEzOE8VmeEwZc0MeU4mMgnyXBw9Wcv6NSs7SuXGzCMj4WPFVjE+AuDWUxiLEmePkwLyLrKDR+olJ43z2v0mFZuT7OH049aCyNnF0nbPWrJch+7nxdbr/Z3P/ZFsHgjC8dTZPgjVRHOKDAStTGb0fMyzepwd07JA0IIJFmJs2hlAoGACYESBjmLJdBOw8tRjG2U0lZcPa0lt01RfYn9uxOo2IPhuF20IG+I+nBAztBZkAvLVbb8ARsdkyRQfOL35sm1i+a1Kkuvo1X3MvkUtEJdnXmsxbnN0cOckDcS7htdIYXIdhnLsi51QyQwxpMO0kIb6QzaV0tzJH3gaZc6adRYrkcCgYABu+P62U9R78AzC9sGsjwQ1lxrwBAq9CCMoglqs7iZijSzCUvrwcHRv4N7gTQDeC3vm76YxhUKrj+7jV959tUQEjEHqV4LftZ1kp+tfbl14qmf5w7ipSN5wrZtwWC3dvIVY7AW7LkVu3HZyYcJvECFaNU+znWcOimnHY2jZVAluw==";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAgdsg6PZw/7BxB+gq9SUg6wd98tcKy4p1x3iBA4iA03O9P2Y5XeHjqtSzBi8QtMY/8wcu+m1214SoMscm2dL0MsQ1tzxLt8I84A8lYvK9sllo9f0aZmZWF8VcsSjbQbOlFQWmxe92g9Mu3ZeD10VDqksSM8rIlhhCdDPo7FouQlIzFdvn/LGNngPjx3S8V3G73Ocz8Y0bl3l6YRReMz2isYNprGxXeafddciwOoMJ3SXXI+rQBIwEpCl7Izeqj9k4PfMEIs9gPrDtvO9yL+IK36NGlURjKnbVYMcsmz2F/tp5794Lm52K3Ss0DaeinJH8i1LdH52jvVC76Lq4c9GufQIDAQAB";

    // 服务器异步通知页面路径
    public static String notify_url = "http://localhost/recharge";

    // 页面跳转同步通知页面路径
    public static String return_url = "http://localhost/recharge";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    @Bean
    DefaultAlipayClient getAlipayClient() {
        return new DefaultAlipayClient(
                gatewayUrl,
                app_id,
                merchant_private_key,
                "json",
                charset,
                alipay_public_key,
                sign_type);
    }


}